//商品相关的接口函数

//引入

import request from "../utils/request"


//获取商品分类列表
export const cateList =(params)=>{
    return request.get("/goods/catelist",{params})
}

//修改商品分类
export const editCate = (data) => {
    return request.post("/goods/editcate", data)
  }

//查询所有启用的分类名称
export const goodsCategories =(params)=>{
  return request.get("/goods/categories",{params})
}

//添加商品
export const goodsAdd = (data) => {
  return request.post("/goods/add", data)
}



//获取商品列表
export const goodsList =(params)=>{
  return request.get("/goods/list",{params})
}

//修改商品
export const goodsEdit =(data)=>{
  return request.post("/goods/edit",data)
}

//删除商品
export const goodsDel =(id)=>{
  return request.get("/goods/del",{params:{id}})
}

//添加商品分类
export const goodsAddcate =(data)=>{
  return request.post("/goods/addcate",data)
}

//删除商品分类
export const goodsDelcate =(id)=>{
  return request.get("/goods/delcate",{params:{id}})
}




//暴露第一种方法
export default{
    cateList,
    editCate,
    goodsCategories,
    goodsAdd,
    goodsList,
    goodsEdit,
    goodsDel,
    goodsAddcate,
    goodsDelcate
  }
